package cn.anecansaitin.whimsy.mixin.client;

import cn.anecansaitin.whimsy.client.event.ModClientEventHooks;
import cn.anecansaitin.whimsy.common.register.ModEffects;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import net.minecraft.client.Minecraft;
import net.minecraft.client.MouseHandler;
import net.minecraft.client.player.LocalPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MouseHandler.class)
public abstract class MouseHandlerMixin {
    @WrapWithCondition(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;turn(DD)V"))
    public boolean wrap$onMove(LocalPlayer instance, double yRot, double xRot) {
        return !ModClientEventHooks.onMouseMove();
    }
}
